#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
int main()
{
	int k;
	char c[105];
	char temp;
	scanf("%s %d", c, &k);
	for (int i = 0; i < strlen(c); i++)
	{
		temp = c[i];
		if (c[i] >= 'a' && c[i] <= 'z')
		{
			c[i] = 'a' + (c[i] - 'a' +  k) % 26;
		}
		if (c[i] >= 'A' && c[i] <= 'Z')
		{
			c[i] = 'A' + (c[i] - 'A' +  k) % 26;
		}
	}
	printf("%s", c);
	return 0;
}